// .txt

beginzonescript;

variables;

short im_hostile = 0;
short last_abil;
short counter = 0;
short set_ter1 = 0;
short i;
body;

beginstate INIT_STATE;
	last_abil = get_current_tick();

	set_name(30001,"Forge Construct");
	set_boss_level(30001,1);
	set_name(30002,"Bone Collector");
	set_boss_level(30002,1);
	set_name(30003,"Bound Eye Tyrant");
	set_boss_level(30003,1);
	set_attack_range(30003,4);
	set_name(30004,"Bony Sentinel");
	set_boss_level(30004,1);
	set_attack_range(30004,4);
	
//	set_attack_range(,);

//	add_ability(short which_char_or_group,short which_slot,short which_ability,0);

//	if (is_town_clear(ME))
//		clean_up_town();
	sf(55,16,0);


	if (gf(55,11) > 0) {
		sf(55,12,1);
		}
		else {
			sf(55,12,0);
			}
	break;

beginstate EXIT_STATE;

break;

beginstate START_STATE;
	//if ((set_ter1 == 0) && (gf(0,0) > 0)) {
	//	set_ter1 = 1;
	//	set_terrain(,,,);
	//	}
		
	// if (gf(,) == 0) {
	//if (get_ran(1,0,100) < 10)
	//	give_char_text_bubble(,"");
	//	}

	//if (gf(,) < 2) {
	//	inc_flag(,,1);
	//	if (gf(,) == 2)
	//		begin_talk_mode();
	//	}

	if (((is_combat()) && (tick_difference(last_abil,get_current_tick()) > 0)) || ((is_town()) && (tick_difference(last_abil,get_current_tick()) > 5))) {
		last_abil = get_current_tick();
		if ((on_which_layer() == 1) && (gf(55,15) > 0) && (gf(55,12) == 0)) {
			if (get_health(5518 + gf(55,14)) < get_max_health(5518 + gf(55,14))  / 2) {
				sf(55,12,1);
				erase_char(5518);
				erase_char(5519);
				erase_char(5520);
				begin_talk_mode(14);
				}
				else {
					inc_flag(55,15,-1);
					if (get_health(5518) < get_max_health(5518) / 3)
						sf(55,15,0);
					if (get_health(5519) < get_max_health(5519) / 3)
						sf(55,15,0);
					if (get_health(5520) < get_max_health(5520) / 3)
						sf(55,15,0);
					if (gf(55,15) == 0) {
						sf(55,15,4);
				
						i = get_health(5518 + gf(55,14)) / 10;
						set_health(5518,i * 10);
						set_health(5519,i * 10);
						set_health(5520,i * 10);
				
						sf(55,14,get_ran(1,0,2));
						set_summon_level(5518,2);
						set_summon_level(5519,2);
						set_summon_level(5520,2);
						set_summon_level(5518 + gf(55,14),0);

						run_text_on_char(5518,"Shimmers!",0);
						run_text_on_char(5519,"Shimmers!",0);
						run_text_on_char(5520,"Shimmers!",0);
				
						if (gf(55,8) == 0) {
							sf(55,8,1);
							begin_talk_mode(13);
							}
					}
				}
			}
		
		}
break;

beginstate 10;
break;

beginstate 11;
break;

beginstate 12;
break;

beginstate 13;
break;

//	print_str("");
//	set_terrain_string_range(".",1);
//	set_terrain_string_range("The sign says - .",1);
